package com.sunny.ynhz.adapter;

import android.graphics.Color;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sunny.ynhz.R;
import com.sunny.ynhz.bean.TimeBean;
import com.sunny.ynhz.utils.TimeUtils;

import java.util.List;

/**
 * Created by huhuan123 on 2018/8/8.
 *
 * @describe TODO
 */

public class WeekYearAdapter extends BaseQuickAdapter<TimeBean, BaseViewHolder> {
    String year;

    public WeekYearAdapter(@Nullable List<TimeBean> data, String year) {
        super(R.layout.item_time, data);
        this.year = year;
    }

    @Override
    protected void convert(BaseViewHolder helper, TimeBean item) {
        if (item.getTime().equals(year)) {
            helper.setTextColor(R.id.tv_time,Color.BLUE);
        } else {
            helper.setTextColor(R.id.tv_time,Color.parseColor("#666666"));
        }
        helper.setText(R.id.tv_time, item.getTime());

    }
}
